#!/usr/bin/env python
# -*- coding: utf-8 -*-
#coding=utf8

# 本文件由自动工具 proto.py 自动生成，请勿修改
# filename msg6000_csbuf.py
# package ptl

from ptl.base_csbuf import *


# message Req6001
class Req6001:
	def __init__(self):
		self.protoid = 6001
		pass

	def Marshal(writer):
		pass

	def Unmarshal( reader):
		pass
# message Resp6001
class Resp6001:
	def __init__(self):
		self.protoid = 6001
		self.arrLevel = []
		self.arrBox = []

	def Marshal(writer):
		countarrLevel = len(self.arrLevel)
		writer.setArray(countarrLevel, 1)
		for i in range(countarrLevel):
			writer.setMessage(0)
			self.arrLevel[i].Marshal(writer)
			writer.endSetMessage()
		countarrBox = len(self.arrBox)
		writer.setArray(countarrBox, 2)
		for i in range(countarrBox):
			writer.setMessage(0)
			self.arrBox[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		for i in range(reader.getArray(1)):
			msg = Level() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.arrLevel.append(msg)
		for i in range(reader.getArray(2)):
			msg = ChapterBox() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.arrBox.append(msg)
# message Req6002
class Req6002:
	def __init__(self):
		self.protoid = 6002
		self.chapterId = 0
		self.boxIndex = 0

	def Marshal(writer):
		writer.setUint32(self.chapterId, 1)
		writer.setUint8(self.boxIndex, 2)

	def Unmarshal( reader):
		self.chapterId = reader.getUint32(1)
		self.boxIndex = reader.getUint8(2)
# message Resp6002
class Resp6002:
	def __init__(self):
		self.protoid = 6002
		self.status = 0

	def Marshal(writer):
		writer.setUint8(self.status, 1)

	def Unmarshal( reader):
		self.status = reader.getUint8(1)
# message Req6003
class Req6003:
	def __init__(self):
		self.protoid = 6003
		self.times = 0
		self.id = 0

	def Marshal(writer):
		writer.setUint8(self.times, 1)
		writer.setUint32(self.id, 3)

	def Unmarshal( reader):
		self.times = reader.getUint8(1)
		self.id = reader.getUint32(3)
# message Resp6003
class Resp6003:
	def __init__(self):
		self.protoid = 6003
		self.status = 0
		self.level = []
		self.arrRewardInfo = []

	def Marshal(writer):
		writer.setUint8(self.status, 1)
		countlevel = len(self.level)
		writer.setArray(countlevel, 2)
		for i in range(countlevel):
			writer.setMessage(0)
			self.level[i].Marshal(writer)
			writer.endSetMessage()
		countarrRewardInfo = len(self.arrRewardInfo)
		writer.setArray(countarrRewardInfo, 3)
		for i in range(countarrRewardInfo):
			writer.setMessage(0)
			self.arrRewardInfo[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		self.status = reader.getUint8(1)
		for i in range(reader.getArray(2)):
			msg = Level() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.level.append(msg)
		for i in range(reader.getArray(3)):
			msg = SingleSweepResult() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.arrRewardInfo.append(msg)
# message Req6004
class Req6004:
	def __init__(self):
		self.protoid = 6004
		self.passType = 0
		self.passArg = 0
		self.levelId = 0
		self.heroId = 0
		self.arrPropIds = []

	def Marshal(writer):
		writer.setUint8(self.passType, 1)
		writer.setUint32(self.passArg, 2)
		writer.setUint32(self.levelId, 3)
		writer.setUint32(self.heroId, 4)
		countarrPropIds = len(self.arrPropIds)
		writer.setArray(countarrPropIds, 5)
		for i in range(countarrPropIds):
			writer.setUint32(self.arrPropIds[i], 0)

	def Unmarshal( reader):
		self.passType = reader.getUint8(1)
		self.passArg = reader.getUint32(2)
		self.levelId = reader.getUint32(3)
		self.heroId = reader.getUint32(4)
		for i in range(reader.getArray(5)):
			self.arrPropIds.append(reader.getUint32(0))
# message Resp6004
class Resp6004:
	def __init__(self):
		self.protoid = 6004
		self.status = 0

	def Marshal(writer):
		writer.setUint8(self.status, 1)

	def Unmarshal( reader):
		self.status = reader.getUint8(1)
# message Resp6005
class Resp6005:
	def __init__(self):
		self.protoid = 6005
		self.arrLevel = []
		self.arrBox = []

	def Marshal(writer):
		countarrLevel = len(self.arrLevel)
		writer.setArray(countarrLevel, 1)
		for i in range(countarrLevel):
			writer.setMessage(0)
			self.arrLevel[i].Marshal(writer)
			writer.endSetMessage()
		countarrBox = len(self.arrBox)
		writer.setArray(countarrBox, 2)
		for i in range(countarrBox):
			writer.setMessage(0)
			self.arrBox[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		for i in range(reader.getArray(1)):
			msg = Level() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.arrLevel.append(msg)
		for i in range(reader.getArray(2)):
			msg = ChapterBox() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.arrBox.append(msg)
# message Req6006
class Req6006:
	def __init__(self):
		self.protoid = 6006
		self.levelId = 0
		self.result = 0
		self.hurt = 0

	def Marshal(writer):
		writer.setUint32(self.levelId, 1)
		writer.setUint32(self.result, 2)
		writer.setUint32(self.hurt, 3)

	def Unmarshal( reader):
		self.levelId = reader.getUint32(1)
		self.result = reader.getUint32(2)
		self.hurt = reader.getUint32(3)
# message Resp6006
class Resp6006:
	def __init__(self):
		self.protoid = 6006
		self.status = 0
		self.levelId = 0
		self.challengeTimes = 0
		self.arrDrop = []

	def Marshal(writer):
		writer.setUint8(self.status, 1)
		writer.setUint32(self.levelId, 2)
		writer.setUint8(self.challengeTimes, 3)
		countarrDrop = len(self.arrDrop)
		writer.setArray(countarrDrop, 4)
		for i in range(countarrDrop):
			writer.setMessage(0)
			self.arrDrop[i].Marshal(writer)
			writer.endSetMessage()

	def Unmarshal( reader):
		self.status = reader.getUint8(1)
		self.levelId = reader.getUint32(2)
		self.challengeTimes = reader.getUint8(3)
		for i in range(reader.getArray(4)):
			msg = RewardInfo() 
			reader.getMessage(0)
			msg.Unmarshal(reader)
			reader.endGetMessage()
			self.arrDrop.append(msg)
